package cn.kgc.tushu.dao;

import cn.kgc.tushu.entity.Emp;
import cn.kgc.tushu.entity.User;
import cn.kgc.tushu.serivce.Opera;

import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * 初始化类
 * 初始化3个图书对象存放map，
 * 初始化2个用户对象存放list。
 */
public class Init {
    public static Map<Integer, Emp> emps=new HashMap<>();
    public static List list = new ArrayList();
    static {
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        Date time1=null;
        Date time2=null;
        Date time3=null;
        try {
            time1=sdf.parse("2018-10-20");
            time2=sdf.parse("2017-10-20");
            time3=sdf.parse("2016-10-20");
            Emp emp1 = new Emp(1,"java编程",20.0,2,time1);
            Emp emp2 = new Emp(2,"c语言",30.0,2,time2);
            Emp emp3 = new Emp(3,"安卓",25.0,1,time3);
            emps.put(1,emp1);
            emps.put(2,emp2);
            emps.put(3,emp3);
            Emp emp = new Emp();
        } catch (ParseException e) {
            e.printStackTrace();
        }

    }
    static {
        User user=new User("admin","123456");
        User user1=new User("李爽","123456");
        list.add(user);
        list.add(user1);
    }
}
